package controller;

import java.io.FileReader;
import java.io.IOException;

public class Main {

    public static void main(String[] args) throws IOException {
        if (args.length < 1) {
            Shell.main(args);
        } else {
            StringBuilder str = new StringBuilder();
            FileReader reader = new FileReader(args[0]);
            for (int i; (i = reader.read()) != -1;) {
                str.appendCodePoint(i);
            }
            System.out.print(new compiler.Compiler().compile(str.toString()).get("M"));
        }
    }
}
